package com.ruoyi.business.mapper;

import com.ruoyi.business.domain.MroLogistics;
import com.ruoyi.business.dto.CheckMorLogisticsDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 物流信息Mapper接口
 *
 * @author wyb
 * @date 2025-07-28
 */
public interface MroLogisticsMapper {
    /**
     * 查询物流信息
     *
     * @param deliveryNo 物流信息主键
     * @return 物流信息
     */
    public MroLogistics selectMroLogisticsByDeliveryNo(String deliveryNo);

    List<MroLogistics> getLogisticsInfoByOuterOrderNo(@Param("outerOrderNo") String outerOrderNo);

    List<MroLogistics> getLogisticsListByOuterOrderNo(@Param("outerOrderNo") String outerOrderNo);

    /**
     * 查询物流信息列表
     *
     * @param mroLogistics 物流信息
     * @return 物流信息集合
     */
    public List<MroLogistics> selectMroLogisticsList(MroLogistics mroLogistics);

    /**
     * 新增物流信息
     *
     * @param mroLogistics 物流信息
     * @return 结果
     */
    public int insertMroLogistics(MroLogistics mroLogistics);

    /**
     * 修改物流信息
     *
     * @param mroLogistics 物流信息
     * @return 结果
     */
    public int updateMroLogistics(MroLogistics mroLogistics);

    /**
     * 删除物流信息
     *
     * @param deliveryNo 物流信息主键
     * @return 结果
     */
    public int deleteMroLogisticsByDeliveryNo(String deliveryNo);

    /**
     * 批量删除物流信息
     *
     * @param deliveryNos 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMroLogisticsByDeliveryNos(String[] deliveryNos);

    //防重校验
    MroLogistics checkMroLogisticsUnique(@Param("deliveryNo") String deliveryNo);

    boolean checkMroLogisticsByOrderNoAndDkIdAndNumberUnique(CheckMorLogisticsDto checkMorLogisticsDto);

    /**
     * 通过订单ID查询物流信息
     *
     * @param outerOrderNos
     * @return
     */
    List<MroLogistics> selectMroLogisticsByOuterOrderNo(List<String> outerOrderNos);

    int bitchUpdateMroLogisticsStatus(@Param("deliveryNoList") List<String> deliveryNoList,
                                      @Param("status") Integer status,
                                      @Param("updateBy") String updateBy);

    List<MroLogistics> distinctList(MroLogistics mroLogistics);

    int deleteMroLogisticsByOuterOrderNo(String outerOrderNo);
}
